package com.redis.controller;

import com.redis.pojo.Product;
import com.redis.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: lizehui
 * @Description:
 * @Date: 2022/11/02/15:01
 */
@RestController
public class ProductController {

    @Autowired
    private ProductService productService;

    @GetMapping("/show/{id}")
    public Product select(@PathVariable Integer id){
        return productService.findProductById(id);
    }
}
